package edu.washington.cs.sounddetector.server.api.methodresult;

import edu.washington.cs.sounddetector.server.api.MethodResult;
import edu.washington.cs.sounddetector.server.api.method.RegisterReceiverPhone;

public class RegisterReceiverPhoneResult extends MethodResult<RegisterReceiverPhone>
{

    private String phoneId;

    protected RegisterReceiverPhoneResult(boolean successful, FailureReason reason, String phoneId)
    {
        super(successful, reason);
        this.phoneId = phoneId;
    }

    @SuppressWarnings("unused")
    private RegisterReceiverPhoneResult()
    {
        this(true, null, null);
    }

    /**
     * @return the phoneId that failed to be registered if this.successful() returns false, null
     *         otherwise
     */
    public String getPhoneId()
    {
        return this.phoneId;
    }

    public static RegisterReceiverPhoneResult success()
    {
        return new RegisterReceiverPhoneResult(true, null, null);
    }
}
